package com.neusoft.jdmscloud.controller;

import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.jdmscloud.bean.Role;
import com.neusoft.jdmscloud.common.JdmsException;
import com.neusoft.jdmscloud.service.impl.RoleService;

@RestController
@RequestMapping("/role")
public class RoleController {
	private Logger logger = LoggerFactory.getLogger(RoleController.class);

	@Autowired
	private RoleService roleService;

	@RequestMapping("/list")
	public List<Role> findList() {

		List<Role> list = new ArrayList<>();
		try {
			logger.info("RoleController -------9101 ----------------");
			list = roleService.findRoles();

		} catch (JdmsException e) {
			e.printStackTrace();
		}

		return list;
	}

}
